CC=gcc
SRC=$(wildcard *.c)  
EXEC=$(patsubst %.c, %, $(notdir ${SRC}))
CFLAGS=-Wall -g -O2

ALL:$(EXEC)	

test1_register:test1_register.c
	$(CC) $^ -o $@ $(CFLAGS)

test2_login:test2_login.c
	$(CC) $^ -o $@ $(CFLAGS)

test3_addDevice:test3_addDevice.c
	$(CC) $^ -o $@ $(CFLAGS)

test4_alarm:test4_alarm.c
	$(CC) $^ -o $@ $(CFLAGS)

test5_getAirConditioning:test5_getAirConditioning.c ../src/device_manage.o
	$(CC) $^ -o $@ $(CFLAGS)

test5_getRefrigerator:test5_getRefrigerator.c ../src/device_manage.o
	$(CC) $^ -o $@ $(CFLAGS)

test6_setAirConditioning:test6_setAirConditioning.c ../src/device_manage.o
	$(CC) $^ -o $@ $(CFLAGS)

test6_setRefrigerator:test6_setRefrigerator.c ../src/device_manage.o
	$(CC) $^ -o $@ $(CFLAGS)

test7_video:test7_video.c ../src/media.o
	$(CC) $^ -o $@ $(CFLAGS)

.PHONY:clean
clean:
	rm $(EXEC) 
